import React, {Component} from "react";
import {
	View,
	Text,
	TextInput,
	Keyboard,
} from "react-native";

export default class KeybordExam extends Component{
	constructor(props) {
		super(props)
	}
	componentWillMount() {
		this.keyboardDidShowListener = Keyboard.addListener("keyboardDidShow", this._keyboardDidShow)
		this.keyboardDidHideListener = Keyboard.addListener("keyboardDidHide", this._keyboardDidHide)
	}
	componentWillUnmount() {
		this.keyboardDidShowListener.remove();
		this.keyboardDidHideListener.remove();
	}

	_keyboardDidShow() {
		alert("keyboard Show")
	}
	_keyboardDidHide() {
		alert("keyboard Hidden")
	}
	render() {
		return (
			<View>
				<TextInput onSubmitEditing={Keyboard.dismiss}/>
				<Text>测试</Text>
			</View>
		);
	}
}